<?php
/*************************\
e107bb Installation Script
by DIPOrg.com
GNU GPL (http://gnu.org)
\*************************/
$errorb=0;
$donotshow=0;
require_once("../../../class2.php");
if(!getperms("P")){ header("location:".e_BASE."index.php"); exit; }
require_once(e_ADMIN.'auth.php');
require_once(e_ADMIN."header.php");
      $selectmonster="SELECT * from e107_cipconf where conf_name='installed'";
      $selectmonster2=mysql_query($selectmonster) or die("could not select monster");
	$selectmonster3=mysql_fetch_array($selectmonster2);
if ($selectmonster3[conf_result]==0) {} else { die("Are you sure you want to config another phpbb installation?"); }
$text = "<font size='5'> e107bb Installation Script</font><br/><br/>";
$forumpath=$_GET[website]."/";
if ($forumpath=="new/")
{
$text .= "<br/>You don't have a phpBB installation?<br/>You need to download and configure phpBB, (phpbb.com) or you can install it using Fantastico... Next start the installation again. ";
$ns -> tablerender("e107bb Installation Script", $text);
require_once(e_ADMIN."footer.php");
exit;
}
if ($forumpath=="e107forum/")
{
$text .= "<br/>You don't have a phpBB installation?<br/>You need to download and configure phpBB, (phpbb.com) or you can install it using Fantastico... Next start the installation again. When you finish go to ".e_BASE."e107_plugins/e107cip/import ";
$ns -> tablerender("e107bb Installation Script", $text);
require_once(e_ADMIN."footer.php");
exit;
}
$text .= "<b>The script will now check if some required files are in the right place.</b><br/>";
//$text .= "including config check<br/>";
if(!include('configcheck.php'))
{
$text .= "<b>Error:</b> Can't find configcheck.php file!<br/>";
$errorb=1;
}
//$text .= "including ".$forumpath."config.php<br/>";
if(!include($forumpath.'config.php'))
{
$text .= "<b>Error:</b> Can't find config.php file! You didn't write the right path to the forum. (You wrote ".$forumpath.")<br/>";
$errorb=1;
$donotshow=1;
}
//$text .= "Your forum is located at ".$forumpath."<br/>";
if(!include('./config.php'))
{
if($donotshow==1)
{
}
else
{
$text .= "<b>Error:</b> You need to upload the file ".$forumpath."config.php to e107_plugins/e107cip/installation<br/>";
}
$errorb=1;
}

if($donotshow==1)
{
$text .= "<br/><b>Go back and write again the path: <a href='index.php'>Back</a></b>";
}
else if($errorb==1)
{
$text .= "<br/><b>There are some errors, correct them and next <a href='check1.php?website=$_GET[website]'>re-check</a></b>";
}
else
{
$text .= "<br/>Everything ok! Please <a href='check2.php?website=$_GET[website]'>continue</a>.";
}
$ns -> tablerender("e107bb Installation Script", $text);

require_once(e_ADMIN."footer.php");
?>